import { createElement, HTMLAttributes, type FC } from 'react';
import classNames from 'classnames';

import { feedContentDefaultProps } from './defaultProps';
import type { FeedContentOptions } from './type';

export interface FeedContentProps extends FeedContentOptions, HTMLAttributes<HTMLDivElement> {}

const FeedContent: FC<FeedContentProps> = (props) => {
  const { className, children, forwardedRef, ...feedContentProps } = props;

  return createElement(
    'div',
    { ref: forwardedRef, className: classNames('content', className), ...feedContentProps },
    children,
  );
};

FeedContent.displayName = 'FeedContent';
FeedContent.defaultProps = feedContentDefaultProps;

export default FeedContent;
